 library ieee;


-- Commonly imported packages:

	-- STD_LOGIC and STD_LOGIC_VECTOR types, and relevant functions
	use ieee.std_logic_1164.all;

	-- SIGNED and UNSIGNED types, and relevant functions
	use ieee.numeric_std.all;

	-- Basic sequential functions and concurrent procedures
	use ieee.VITAL_Primitives.all;


use IEEE.STD_LOGIC_UNSIGNED.ALL;



entity filter_video is
	port(
		DEC_i	: in std_logic;   --input_CLK	
		DEC_D_i		: in std_logic_vector(7 downto 0);		
		DEC_o	: out std_logic;   --input_CLK
		DEC_D_o		: out std_logic_vector(7 downto 0)
		);
end entity;

-- Library Clause(s) (optional)
-- Use Clause(s) (optional)

architecture rtl of filter_video is

begin



bt_601_eav_sav:
process (DEC_i)
variable pix_counter:integer;
variable std_buf_1:std_logic_vector(7 downto 0)	;
variable std_buf_2:std_logic_vector(7 downto 0)	;
variable buf_sel:std_logic;
begin
	if (rising_edge(DEC_i))then
			if(buf_sel = '1')then
				 std_buf_1:=DEC_D_i;
				 DEC_D_o<=std_buf_2;
				 buf_sel:= not(buf_sel);
			else
				 std_buf_2:=DEC_D_i;
				 DEC_D_o<=std_buf_1;
				 buf_sel:= not(buf_sel);
			end if;
	end if;				

end process;

DEC_o <= DEC_i;

end rtl;